package com.atguigu.controller;

import com.atguigu.resp.ResultData;
import com.atguigu.service.CouponService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/coupon")
@Slf4j
public class CouponController {

    @Resource
    CouponService couponService;

    //http://localhost:8080/coupon/sendV1
    @GetMapping("/sendV1")
    public ResultData<String> sendV1() {
        couponService.batchTaskActionV1();
        return ResultData.success("success");
    }

    //http://localhost:8080/coupon/sendV2
    @GetMapping("/sendV2")
    public ResultData<String> sendV2() {
        couponService.batchTaskActionV2();
        return ResultData.success("success");
    }
}
